package com.terheyden.pluginLoaderDemo;

/**
 * Example app that dynamically supports loading plugins.
 */
public class App {

    /**
     * Dir we'll grab plugins from.
     */
    private static final String PLUGIN_SUBDIR = "/plugins";

    /**
     * Simple worker class for the app.
     */
    private static AppLogic appLogic;

    /**
     * Main app execution.
     */
    public static void main(String[] args) {

        // Initialize the app...
        appLogic = new AppLogic();

        appLogic.say("Welcome to the plugin loader demo.");
        appLogic.say("Loading plugins...");

        // Dynamically load .jars from the /plugins dir.
        PluginManager.loadPlugins(appLogic, PLUGIN_SUBDIR);
    }

}

/*

Console output:

Welcome to the plugin loader demo.
Loading plugins...
Loading plugin: PluginImpl
Sample plugin is loaded!
2 + 2 = 4

*/
